﻿<!doctype html>
<html>
	<head>
		<meta http-equiv="Content-Type" content="text/html; charset=UTF-8" />
		<meta name="viewport" content="width=device-width, initial-scale=1.0, minimum-scale=1.0, maximum-scale=1.0, user-scalable=yes" />
		<meta name="applicable-device" content="mobile">
		<title>财富密码</title>
		<meta content="240" name="MobileOptimized">
		<link href="css/index_3.css" rel="stylesheet" type="text/css" media="screen, projection" />
		<link href="css/index_new_3.css" rel="stylesheet" type="text/css" media="screen, projection" />
	</head>

	<body>
		<div class="container recharge-page ">
			<div class="head-bar">
				<a class="back-btn" id="backBtnOuter" href="javascript:history.back(-1);">
					<img src="picture/icon_arrow_left_white_1.png" />
				</a>
				人民币充值
				<a class="record-btn" href="accountRecord.html">充值记录</a>
			</div>
		
			<div class="tab-content cny active" id="bankRechargeInfo" style="">
		
				<div class="recharge-form" style="margin-top: 10px;">
					<div class="line">
						<span class="label">汇款人姓名</span>
						<span class="exp">财富密码<i> (仅支持您本人银行卡充值)</i></span>
					</div>
				</div>
		
				<div class="block-lines" style="margin: 0px;padding: 0px;">
					<div style="display: inline-block;height: 44px;line-height: 44px;width: 97.5%;margin-left: 2.5%;border-bottom: 1px solid #d9d9d9;">
						<span class="label" style="float: left;">银行</span>
						<div class="line drop-arrow banker-chooser" style="padding: 0px;float: left;width: 65%;" onclick="chooseBank()">
							<span class="label" style="width: auto;" id="openBank" codeValue="-1">选择开户银行</span>
						</div>
					</div>
					<div id="bankListDiv" class="line" style="height:auto;display:none;margin-top: -5px;">
						<ul id="bankList" class="selContent bankList" style="display:none;">
		
							<li onclick="chooseBankInfo(this);chooseBankInfoTips(this,'errTips')" code="16" style="margin-left: 2.5%;">
								<img width="24" height="24" src="picture/bank16.png">
								<span>平安银行</span>
							</li>
		
							<li onclick="chooseBankInfo(this);chooseBankInfoTips(this,'errTips')" code="1" style="margin-left: 2.5%;">
								<img width="24" height="24" src="picture/bank1.png">
								<span>中国银行</span>
							</li>
		
							<li onclick="chooseBankInfo(this);chooseBankInfoTips(this,'errTips')" code="2" style="margin-left: 2.5%;">
								<img width="24" height="24" src="picture/bank2.png">
								<span>中国工商银行</span>
							</li>
		
							<li onclick="chooseBankInfo(this);chooseBankInfoTips(this,'errTips')" code="3" style="margin-left: 2.5%;">
								<img width="24" height="24" src="picture/bank3.png">
								<span>招商银行</span>
							</li>
		
							<li onclick="chooseBankInfo(this);chooseBankInfoTips(this,'errTips')" code="4" style="margin-left: 2.5%;">
								<img width="24" height="24" src="picture/bank4.png">
								<span>中国建设银行</span>
							</li>
		
							<li onclick="chooseBankInfo(this);chooseBankInfoTips(this,'errTips')" code="5" style="margin-left: 2.5%;">
								<img width="24" height="24" src="picture/bank5.png">
								<span>中国农业银行</span>
							</li>
		
							<li onclick="chooseBankInfo(this);chooseBankInfoTips(this,'errTips')" code="8" style="margin-left: 2.5%;">
								<img width="24" height="24" src="picture/bank8.png">
								<span>广东发展银行</span>
							</li>
		
							<li onclick="chooseBankInfo(this);chooseBankInfoTips(this,'errTips')" code="10" style="margin-left: 2.5%;">
								<img width="24" height="24" src="picture/bank10.png">
								<span>中国交通银行</span>
							</li>
		
							<li onclick="chooseBankInfo(this);chooseBankInfoTips(this,'errTips')" code="11" style="margin-left: 2.5%;">
								<img width="24" height="24" src="picture/bank11.png">
								<span>中信银行</span>
							</li>
		
							<li onclick="chooseBankInfo(this);chooseBankInfoTips(this,'errTips')" code="13" style="margin-left: 2.5%;">
								<img width="24" height="24" src="picture/bank13.png">
								<span>中国光大银行</span>
							</li>
		
							<li onclick="chooseBankInfo(this);chooseBankInfoTips(this,'errTips')" code="0" style="border-bottom: 1px solid #d9d9d9;margin-left: 2.5%;">
								<em><img width="24" height="24" src="picture/bank_other.png"></em>
								<span>其他银行</span>
							</li>
						</ul>
					</div>
					<input type="hidden" id="cardTotal" value="0">
				</div>
				<div class="recharge-form" style="margin-top: 0px;">
					<div class="line">
						<span class="label">汇款人银行卡号</span>
						<input type="text" id="bankAccount" placeholder="请输入您要汇款的银行卡号" oncopy="return false;" onpaste="return false;" onkeyup="onkeyupBankAccount(this)" onafterpaste="this.value=this.value.replace(/\D/g,'')" onBlur="this.value = this.value.replace(/^\D|\D$/, '')">
					</div>
				</div>
		
				<div id="errTips" class="err-tips"></div>
		
				<input class="submit-btn" type="button" id="submitHitAddress" onclick="alert('充值成功');" value="充值">
		
				<p class="chargeTipsTitle">充值须知</p>
				<ul class="chargeTips">
		
					<li>1.仅接受实名认证客户本人银行卡充值，请勿使用他人银行卡汇款。</li>
					<li>2.实名认证一旦通过不允许修改。</li>
		
				</ul>
		
				<p class="recharge-list-title" style="display: none;">未完成的充值记录</p>
		
				<ul class="recharge-list" style="display:none;">
		
					<li class="empty">
						<div class="top-line">您暂时没有充值记录</div>
					</li>
		
				</ul>
		
			</div>
			<div id="myBankCards" class="myBankCards" style="display: none;">
				<ul id="ulFinCnyAddress">
		
				</ul>
				<a href="/mobileTrade/toAddBanCard.do" class="addBankCard">
					<span>+ 添加银行卡</span>
				</a>
			</div>		
		</div>

		<script type="text/javascript" src="js/jquery-1.8.2_1.js"></script>
		<script type="text/javascript" src="js/common_1.js"></script>
		<script type="text/javascript">
		    function chooseBankInfo(li){
		        var html = li.innerHTML;
		        var code = jQuery(li).attr("code");
		        jQuery("#openBank").html(html);
		        jQuery("#openBank").attr("codeValue",code);
		        jQuery("#bankListDiv").hide();
		        adjustFooter();
		    }
		
		    function chooseBank() {
		        jQuery("#bankList").toggle();
		        jQuery("#bankListDiv").toggle();
		        adjustFooter();
		    }
		
		    function changeChargeBank(li) {
		        var code = jQuery(li).attr("code");
		        var addressId = jQuery(li).attr("addressId")
		        var url = "/account/rechargeCnyInfo.do";
		        var param = {bankId:code,addressId:addressId};
		        jQuery.post(url,param,function (data) {
		            var result = eval('(' + data + ')');
		            var bankNo = result.bankNo.replace(/&nbsp;/g,"").replace(/ /g,"")
		            jQuery("#inPeeName").text(result.bankName);
		            jQuery("#inAccount").text(bankNo);
		            jQuery("#inBank").text(result.bankAddr);
		        })
		        jQuery("#backBtnOuter").show();
		        jQuery("#backBtnInner").hide();
		    }
		
		    function getChargeBank(code,addressId) {
		        var url = "/account/rechargeCnyInfo.do";
		        var param = {bankId:code,addressId:addressId};
		        jQuery.post(url,param,function (data) {
		            var result = eval('(' + data + ')');
		            var bankNo = result.bankNo.replace(/&nbsp;/g,"").replace(/ /g,"")
		            jQuery("#inPeeName").text(result.bankName);
		            jQuery("#inAccount").text(bankNo);
		            jQuery("#inBank").text(result.bankAddr);
		        })
		    }
		
		    function chooseBankInfoTips(li,tipsId){
		        var code = jQuery(li).attr("code");
		        if(code==0){
		            document.getElementById(tipsId).innerHTML = get$("otherbankrechargetips");
		        }else{
		            document.getElementById(tipsId).innerHTML = "";
		        }
		    }
		    function chooseBankInfoTipsselected(){
		        var code = jQuery("#selectedCard").attr("code");
		        if(code==0){
		            document.getElementById('errTips').innerHTML = get$("otherbankrechargetips");
		        }else{
		            document.getElementById('errTips').innerHTML = "";
		        }
		    }
		    
		
		    // 格式化显示银行账号
		    function onkeyupBankAccount(account){
		        var banknumber = account.value.replace(/\D/g,'');
		        account.value = plusSpace(banknumber);
		    }
		    function plusSpace(banknumber){
		        var length = banknumber.length;
		        var newbanknumber = "";
		        if(length > 4){
		            var size = parseInt(length/4);
		            for (var i = 0; i < size; i++) {
		                var start = i*4;
		                var end = (i+1)*4;
		                if((i+1)*4 > length){
		                    end = length;
		                }
		                var str = banknumber.substring(start,end);
		                newbanknumber += str+" ";
		            };
		            if(length%4 != 0){
		                newbanknumber += banknumber.substring(size*4,length);
		            }else{
		                var endstr = newbanknumber.substring(newbanknumber.length-1,newbanknumber.length);
		                if(endstr == " "){
		                    newbanknumber = newbanknumber.substring(0,newbanknumber.length-1);
		                }
		            }
		        }else{
		            return banknumber;
		        }
		        return newbanknumber;
		    }
		    jQuery("#selectedCard").click(function(){
		        jQuery("#myBankCards").show();
		        jQuery("#bankRechargeInfo").hide();
		
		        jQuery("#backBtnOuter").hide();
		        jQuery("#backBtnInner").show();
		
		    });
		
		    jQuery("#backBtnInner").click(function () {
		        jQuery("#myBankCards").hide();
		        jQuery("#bankRechargeInfo").show();
		        jQuery("#backBtnOuter").show();
		        jQuery("#backBtnInner").hide();
		    })
		    
		
		    function addBankInfo(li){
		        var html = li.innerHTML;
		        var code = jQuery(li).attr("code");
		        var addressId = jQuery(li).attr("addressId");
		        jQuery("#selectedCard").html(html);
		        jQuery("#selectedCard a .delete").html(" ");
		        jQuery("#selectedCard").attr("code",code);
		        jQuery("#selectedCard").attr("addressId",addressId);
		        showByBankCards();
		    }
		
		    function showByBankCards() {
		        jQuery("#myBankCards").toggle();
		        jQuery(".liOuter").show();
		        jQuery("#myBankCards").hide();
		        jQuery("#bankRechargeInfo").show();
		    }
		
		    /*简单校验身份证号码位数的正确性*/
		    function identityCheck(card){
		        // 身份证号码为15位或者18位，15位时全为数字，18位前17位为数字，最后一位是校验位，可能为数字或字符X
		        if(null == card || ""==card){
		            return false;
		        }
		        var reg = /(^\d{15}$)|(^\d{18}$)|(^\d{17}(\d|X|x)$)/;
		        if(reg.test(trim(card))){
		            return  true;
		        }else{
		            return  false;
		        }
		    }
		
		    function checkField() {
		        var name = jQuery("#realName").val();
		        var idNum = jQuery("#idNumber").val();
		        var passport = jQuery("#passport").val();
		        if(jQuery("#checkbox").hasClass("checked") && name != "" && (idNum != "" || passport != "")){
		            jQuery("#submitBtn").css("background-color","#0094e2");
		            jQuery("#submitBtn").css("pointer-events","all");
		        }else{
		            jQuery("#submitBtn").css("background-color","#cccccc");
		            jQuery("#submitBtn").css("pointer-events","none");
		        }
		    }
		</script>

		<div class="foot">
			<div class="last">
				<ul class="top">
					<li class="load" style="width: 60%;text-align: left;">
						<em style="color: #fff;">180****5154</em>
						<a href="javascript:void(0);" onclick="alert('改功能还在开发中');">退出</a>
					</li>
				</ul>
			</div>
			<ul class="support">
				<div class="index_friendLink" style="margin: 0px 5%;">
					<div class="inner_block">
						<span style="color: #6d6f73;">友情链接：</span>
						<a style="color: #6d6f73;" target="_blank" href="https://www.thgo8.com/">通惠购</a>
					</div>
				</div>

				<li class="reserved">
					<span class="standard darkgray">©2013-2017 财富密码 版权所有</span>
				</li>
			</ul>
		</div>
	</body>
</html>